package com.lcj.mis.controller;

import com.lcj.common.util.Result;
import com.lcj.mis.controller.form.DriverLockDownForm;
import com.lcj.mis.service.DriverLockDownService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/driverLockDown")
public class DriverLockDownController {

    @Autowired
    private DriverLockDownService driverLockDownService;

    @PostMapping("/add")
    public Result add(@RequestBody DriverLockDownForm form) {
        if(form.getId() != null) {
            //修改
            return driverLockDownService.update(form);
        }
        return driverLockDownService.add(form);
    }

    @PostMapping("/delete")
    public Result delete(@RequestBody DriverLockDownForm form) {
        return driverLockDownService.delete(form);
    }

    @PostMapping("/update")
    public Result update(@RequestBody DriverLockDownForm form) {
        return driverLockDownService.update(form);
    }

    @PostMapping("/get")
    public Result get(@RequestBody DriverLockDownForm form) {
        return driverLockDownService.get(form);
    }

    @PostMapping("/list")
    public Result list(@RequestBody DriverLockDownForm form) {
        return driverLockDownService.list(form);
    }

}